package tq.com.tqteacher.view;

import android.content.Context;
import android.graphics.drawable.Drawable;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.util.AttributeSet;
import android.widget.ImageButton;
import android.widget.TextView;

import tq.com.tqcom.view.TQHeader5View;
import tq.com.tqteacher.R;

public class TQHeaderPublish extends TQHeader5View {
    public TQHeaderPublish(@NonNull Context context, @Nullable AttributeSet attrs) {
        super(context, attrs);
    }

    @Override
    protected void initBack(ImageButton pBackIcon) {
        super.initBack(pBackIcon);
        pBackIcon.setVisibility(INVISIBLE);
    }

    @Override
    protected void initTitle(TextView pTitleView) {
        super.initTitle(pTitleView);
        pTitleView.setText("发布");
    }

    @Override
    protected void initRightView(TextView pRightView) {
        super.initRightView(pRightView);

        pRightView.setText("新建发布");
        Drawable left = getResources().getDrawable(R.drawable.icon_add, null);
        left.setBounds(0, 0, left.getMinimumWidth(), left.getMinimumHeight());
        pRightView.setCompoundDrawables(left, null, null,null);


        pRightView.setCompoundDrawablePadding((int) getResources().getDisplayMetrics().density * 10);
    }
}
